package com.naiterui.ehp.bp.constants;

import java.util.Objects;

/**
 * <pre>
 *      患者智能标签
 * </pre>
 *
 * @author 王泽浩
 * @date 2018/7/30 下午2:07
 * @since 1.0.0
 */
public class PatientIntelligentLabel {

    /**
     * 智能标签redis key
     */
    private static final String PATIENT_INTELLIGENTLABEL_KEY = CommonConstant.REDIS_PRE_DR + "intelligent_label_%s_%s";

    /**
     * 获取诊断时间key
     *
     * @param doctorId 医生ID
     *
     * @return
     */
    public static String getRevisitTimeKey(Long doctorId) {
        Objects.requireNonNull(doctorId, "获取诊断时间key失败，医生ID不能为null");
        return String.format(PATIENT_INTELLIGENTLABEL_KEY, doctorId, "revisittime");
    }

    /**
     * 获取诊断结果KEY
     *
     * @param doctorId 医生ID
     *
     * @return
     */
    public static String getDiagnosisKey(Long doctorId) {
        Objects.requireNonNull(doctorId, "获取诊断结果key失败，医生ID不能为null");
        return String.format(PATIENT_INTELLIGENTLABEL_KEY, doctorId, "diagnosis");
    }

    /**
     * 获取X天无药key
     *
     * @param doctorId 医生ID
     *
     * @return
     */
    public static String getXDayNoMedicineKey(Long doctorId) {
        Objects.requireNonNull(doctorId, "获取X天无药key失败，医生ID不能为null");
        return String.format(PATIENT_INTELLIGENTLABEL_KEY, doctorId, "xdaynomedicine");
    }

}
